<template>
  <ContainerGroup>
    <Container class="basic-msg">
      <div class="left">
        <div class="text-box">
          <div class="department">{{ patientMsg.deptName }}</div>
          <div class="doctor">医生：{{ patientMsg.emplName }}</div>
          <div class="time">{{ patientMsg.yysj.split(' ')[0] }}</div>
        </div>
      </div>
      <div class="right">
        <div class="patient-name">姓名：{{ patientMsg.name }}</div>
        <div class="patient-gender">性别：{{ patientMsg.sex===1?'男':'女' }}</div>
        <div class="patient-age">年龄：{{ patientMsg.age }}</div>
        <div class="patient-telphone">联系电话：{{ patientMsg.linkmanTel }}</div>
        <div class="patient-diagnosis">诊断：{{ patientMsg.diagName }}</div>
        <div class="patient-state">医保类型：{{ patientMsg.yblx }}</div>
        <div class="patient-patientNumber">门诊号：{{ patientMsg.mcardNo }}</div>
        <div class="patient-recipeNumber">诊断号：{{ patientMsg.clinicCode }}</div>
        <div class="patient-state">
          状态：
          <span v-if="patientMsg.preState==='0'">取消</span>
          <span v-else-if="patientMsg.preState==='1'">预约</span>
          <span v-else-if="patientMsg.preState==='2'">转入</span>
          <span v-else-if="patientMsg.preState==='3'">出院</span>
          <span v-else-if="patientMsg.preState==='4'">待床</span>
          <span v-else-if="patientMsg.preState==='5'">已通知</span>
          <span v-else-if="patientMsg.preState==='6'">无费退院</span>
          <span v-else>作废</span>
        </div>
        <div class="patient-inpatient-ward">病区：{{ patientMsg.nurseCellCode }}</div>
      </div>
      <div class="patient-icon" @click="patient360">
        <i>{{ "" }}</i>
        <span class="patient-icon-span">患者360</span>
      </div>
    </Container>
    <Container class="detail-msg">
      <div class="checkout">
        <div class="line-title">
          <div class="title-icon checkout-icon">
            <i>{{ "" }}</i>
            <span>检验</span>
          </div>
          <div class="query-reset-btn right-btn-container">
            <div v-for="(item, index) in buttonList" :key="index + '_'" class="form-item-btn">
              <Button
                :type="item.type"
                :icon="item.icon"
                :loading="item.loading"
                @click="item.handlerClick"
              >{{ item.label }}</Button>
            </div>
          </div>
        </div>
        <div class="detail-info">
          <div v-for="(item, index) in checkoutData" :key="index" class="checkout-box">
            <div class="title-line">
              <div class="checkout-data-title">
                <i>{{ "" }}</i>
                {{ `【${item.requesttime}】 [${item.doctrequestno}] ${item.examinaim}` }}
              </div>
              <div class="extend-checkout-data" @click="extendInfo(item)">
                {{ item.extend ? "收起" : "展开" }}
                <i
                  v-if="!item.extend"
                  class="el-icon-arrow-down"
                >{{ "" }}</i>
                <i v-else class="el-icon-arrow-up">{{ "" }}</i>
              </div>
            </div>
            <div v-show="item.extend" class="checkout-info">
              <el-table
                :data="item.ljysqdxxXmmxList"
                stripe
                style="width: 100%"
                :header-cell-style="{'text-align':'center'}"
              >
                <el-table-column prop="ylmc" label="检查项目">
                  <template slot-scope="scope">
                    <div>
                      <i
                        class="el-icon-circle-check"
                        :style="{marginRight:'10px',color:(scope.row.checktime?'#2165f9':'transparent')}"
                      >{{ '' }}</i>
                      <span>{{ scope.row.examinaim }}</span>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column prop="executetime" label="执行" align="center" />
                <el-table-column prop="receivetime" label="收标本" align="center" />
                <el-table-column prop="checktime" label="报告日期" align="center" />
                <el-table-column prop="operation" label="操作" align="center">
                  <template slot-scope="scope">
                    <i class="get-detail" @click="visitDetail(scope.row)">{{ '' }}</i>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
      </div>
    </Container>
    <Container class="detail-msg">
      <div class="inspect">
        <div class="line-title">
          <div class="title-icon inspect-icon">
            <i>{{ "" }}</i>
            <span>检查</span>
          </div>
        </div>
        <div class="detail-info">
          <el-table
            :data="inspectData"
            stripe
            style="width: 100%"
            :header-cell-style="{'text-align':'center'}"
          >
            <el-table-column prop="project" label="检查项目" />
            <el-table-column prop="state" label="状态" align="center">
              <template slot-scope="scope">{{ scope.row.state === '1' ? '收费' : '未收费' }}</template>
            </el-table-column>
            <el-table-column prop="applyTime" label="申请时间" align="center" />
            <el-table-column prop="orderTime" label="预约时间" align="center" />
            <el-table-column prop="executeDate" label="执行日期" align="center" />
            <el-table-column prop="operation" label="操作" align="center">
              <template slot-scope="scope">
                <i class="get-detail" @click="visitDetail(scope.row)">{{ '' }}</i>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </Container>
    <Container class="detail-msg">
      <div class="history">
        <div class="line-title">
          <div class="title-icon history-icon">
            <i>{{ "" }}</i>
            <span>患者状态</span>
          </div>
        </div>
        <div class="detail-info">
          <el-table
            :data="historyData"
            stripe
            style="width: 100%"
            :header-cell-style="{'text-align':'center'}"
          >
            <el-table-column prop="yysj" label="预约时间" align="center" />
            <el-table-column prop="ryTime" label="入院时间" align="center" />
            <el-table-column prop="cyrq" label="出院时间" align="center" />
            <el-table-column prop="lastingDays" label="住院天数" align="center">
              <template slot-scope="scope">
                {{ showDays(scope.row) }}
              </template>
            </el-table-column>
            <el-table-column prop="qxsj" label="取消时间" align="center">
              <template slot-scope="scope">
                {{ scope.row.qxsj ? scope.row.qxsj : '暂无记录' }}
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </Container>
    <el-dialog title="新增检验项目" :visible.sync="dialogFormVisible">
      <el-form :model="addProjectForm">
        <el-form-item label="检验项目" label-width="120px">
          <el-select v-model="addProjectForm.project" placeholder="请选择">
            <el-option
              v-for="item in projectList"
              :key="item.id"
              :label="item.name"
              :value="item.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="执行时间" label-width="120px">
          <el-date-picker v-model="addProjectForm.excuteTime" type="date" placeholder="请选择" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </ContainerGroup>
</template>

<script>
import { getVYqBrdjxx, getReportDetail } from '../../utils/apis/preparedness'

export default {
  name: 'Detail',
  data() {
    return {
      patientMsg: {
        cardNo: null,
        name: '沈仁娜',
        sex: '2',
        birthday: null,
        deptCode: null,
        deptName: '泌尿外科',
        sdeptCode: null,
        paykindCode: null,
        pactCode: null,
        bedNo: null,
        nurseCellCode: null,
        operDtime: null,
        operCode: null,
        prepayCost: null,
        idenno: null,
        profCode: null,
        workName: null,
        workTel: null,
        home: null,
        homeTel: null,
        dist: null,
        birthArea: null,
        nationCode: null,
        linkmaName: null,
        linkmanTel: '13806255111',
        linkmanAdd: null,
        relaCode: null,
        mari: null,
        counCode: null,
        mcardNo: '0005121585',
        predate: null,
        predoctCode: null,
        diagCode: null,
        diagName: '左肾肿物',
        preState: '3',
        inState: null,
        beizhu: null,
        ifInhos: null,
        ifInhosPlan: null,
        ifInhosExternal: null,
        ifEmergency: null,
        ifWalk: null,
        ifChair: null,
        ifAmbulance: null,
        ifRjbf: null,
        clinicCode: 'MZ000023492359',
        patientTag: null,
        inpatientNo: null,
        ryTime: '2021-08-03 09:46:32',
        ryCode: null,
        preid: null,
        cancelTime: null,
        readyTime: null,
        zlzz: null,
        mszd: null,
        tzTime: null,
        tzCode: null,
        registeStatus: null,
        isManual: null,
        emplName: '姚裘',
        ryzt: null,
        ryxb: null,
        yblx: '自费',
        wzxs: null,
        yzxs: null,
        rynl: null,
        yyrq: null,
        ryrq: null,
        cyrq: '2021-08-17',
        qxsj: null,
        czsj: null,
        yysj: '2022-07-07 00:00:00',
        ztpx: null,
        lxdh: null,
        zyts: null,
        patientNoSz: null,
        nurseCellName: '东十三病区',
        bedNoIn: null,
        age: '73',
        lisApplys: null,
        erApplyItemOuts: [
          {
            xmbh: null,
            fzbh: null,
            xmmc1: null,
            xmmc2: null,
            sj: null,
            brmzh: '0005121585',
            brcfh: 'MZ000023492359',
            mzsqbh: 5462993,
            dy1: null,
            dy2: null,
            dy3: null,
            lxbh: 114
          },
          {
            xmbh: null,
            fzbh: null,
            xmmc1: null,
            xmmc2: null,
            sj: null,
            brmzh: '0005121585',
            brcfh: 'MZ000023492359',
            mzsqbh: 5462994,
            dy1: null,
            dy2: null,
            dy3: null,
            lxbh: 122
          }
        ],
        progress: null
      },
      height: 'fill',
      buttonList: [
        {
          label: '+新增检验项目',
          type: 'primary',
          handlerClick: this.handlerAdd,
          loading: false
        }
      ],
      checkoutData: [
        {
          doctrequestno: '1061565541',
          requesttime: '2021-07-30T11:29:10',
          requester: '002302',
          sqdstatus: 4,
          stayhospitalmode: 1,
          brxz: null,
          patientid: '0005121585',
          patientname: '沈仁娜',
          sex: '2',
          birthday: '1948-07-21T00:00:00',
          age: '73',
          ageUnit: '1',
          section: '1034',
          bedNo: null,
          requestmode: 0,
          diagnostic: '肾肿物',
          fee: null,
          examinaim: '■新型冠状病毒核酸+外科院前组套+',
          examinaimcode: '12496,12518,',
          hislb: 1,
          executetime: '2021-08-03T09:09:22',
          executor: '107223',
          receivetime: null,
          receiver: null,
          samplestatus: null,
          canceler: null,
          canceltime: null,
          fphm: '001002020396',
          notes: '</XG#咽拭子^799314^12496#XG/>',
          ylxh: 'U0000080302807',
          pathctrl: null,
          brid: 0,
          isyy: null,
          yyrq: null,
          ksdm: null,
          patientno: 'MZ000023492359',
          computer: '172.30.22.228',
          ywsybh: null,
          sfzh: '320525194807215625',
          lxdh: null,
          lxdz: null,
          ybbh: '0005121585',
          hosarea: null,
          kdprogram: null,
          patienttag: null,
          electrrequestno: '1188217116017602560',
          ljysqdxxXmmxList: [
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '血细胞分析(血常规)',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-03 09:09:22',
              executor: null,
              receivetime: '2021-08-03 09:09:22',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-03 09:27:10',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            },
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '凝血系列',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-03 09:09:22',
              executor: null,
              receivetime: '2021-08-03 10:08:59',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-03 10:35:42',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            },
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '生化全套',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-03 09:09:22',
              executor: null,
              receivetime: '2021-08-03 09:52:06',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-03 11:06:34',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            },
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '输血前检查',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-03 09:09:22',
              executor: null,
              receivetime: '2021-08-03 10:51:19',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-03 12:49:14',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            },
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '尿液分析',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-02 09:32:19',
              executor: null,
              receivetime: '2021-08-02 09:56:39',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-02 10:21:19',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            },
            {
              doctadviseno: null,
              sampleno: null,
              requester: null,
              requesttime: null,
              section: null,
              bedNo: null,
              stayhospitalmode: null,
              brxz: null,
              patientid: null,
              patientname: null,
              sex: null,
              birthday: null,
              age: null,
              ageUnit: null,
              sampletype: null,
              toponymy: null,
              examinaim: '■新型冠状病毒核酸（自费）',
              examinaimcode: null,
              requestmode: null,
              fee: null,
              feestatus: null,
              executetime: '2021-08-02 09:59:57',
              executor: null,
              receivetime: '2021-08-02 12:04:07',
              receiver: null,
              samplestatus: null,
              sampleNotes: null,
              canceler: null,
              canceltime: null,
              notes: null,
              diagnostic: null,
              labdepartment: null,
              cycle: null,
              sampleJszt: null,
              fphm: null,
              transed: null,
              perDoctadviseno: null,
              mfpb: null,
              bqlx: null,
              lislx: null,
              hislb: null,
              bbfh: null,
              doctrequestno: '1061565541',
              threceiver: null,
              threceivetime: null,
              department: null,
              testexecutor: null,
              testexecutetime: null,
              isnew: null,
              bgsj: null,
              txsj: null,
              checktime: '2021-08-02 14:05:29',
              brid: null,
              submittime: null,
              submiter: null,
              abnorreason: null,
              bqprint: null,
              hisfeecode: null,
              ksdm: null,
              patientno: null,
              receivetime2: null,
              receiver2: null,
              bbcl: null,
              jsph: null,
              sfzh: null,
              ybbh: null,
              lxdh: null,
              computer: null,
              recordtime: null,
              clbz: null,
              computername: null,
              ip: null,
              wysampleszt: null,
              hosarea: null,
              note: null,
              patienttag: null,
              statetime: null
            }
          ]
        }
      ],
      inspectData: [
        {
          project: '【64排CT】胸部平扫，腹部平扫，腹部增强，盆腔平扫，盆腔增强',
          state: '1',
          applyTime: '2021-07-17',
          orderTime: '2021-07-17',
          executeDate: '2021-07-17'
        },
        {
          project: '放散式冲击波',
          state: '0',
          applyTime: '2021-07-17',
          orderTime: '2021-07-17',
          executeDate: '2021-07-17'
        }
      ],
      historyData: [
        {
          yysj: '2022-07-07 00:00:00',
          qxsj: null,
          ryTime: '2021-08-03 09:46:32',
          cyrq: '2021-08-17'
        }
      ],
      dialogFormVisible: false,
      addProjectForm: {
        project: '',
        executeDate: ''
      },
      projectList: [
        {
          id: 0,
          name: '放散式冲击波'
        },
        {
          id: 1,
          name: '核磁共振'
        },
        {
          id: 2,
          name: '脑CT'
        }
      ],
      preId: ''
    }
  },
  activated() {
    this.preid = this.$route.query.preid
  },
  mounted() {
    this.checkoutData.forEach(item => {
      this.$set(item, 'extend', false)
    })
    this._getVYqBrdjxx()
  },
  methods: {
    _getVYqBrdjxx() {
      const params = {
        preid: this.preid
      }
      getVYqBrdjxx(params).then(res => {
        if (res.data.code === 200) {
          this.patientMsg = res.data.data.vyqBrdjxx
          this.checkoutData = res.data.data.ljysqdxxes
          const obj = {
            ryTime: res.data.data.vyqBrdjxx.ryTime,
            cyrq: res.data.data.vyqBrdjxx.cyrq,
            yysj: res.data.data.vyqBrdjxx.yysj,
            qxsj: res.data.data.vyqBrdjxx.qxsj
          }
          this.historyData[0] = obj
        } else {
          this.$message.error(res.data.message)
        }
      })
      getReportDetail().then(res => {
        if (res.data.code === 200) {
          this.inspectData = ''
        } else {
          this.$message.error(res.data.message)
        }
      })
    },
    handlerAdd() {
      this.dialogFormVisible = true
    },
    extendInfo(item) {
      console.log(item)
      item.extend = !item.extend
    },
    visitDetail(row) {
      console.log(row)
      alert(row.project)
    },
    patient360() {
      const url = `http://172.16.2.226:8041/Patient/VisitRecord?PageType=RECORDINFO&PatientNo=${this.patientMsg.clinicCode}`
      window.open(url, '_blank')
    },
    showDays(row) {
      if (!row.qxsj) {
        let startDay = row.ryTime.split(' ')[0].split('-')
        let endDay = row.cyrq.split('-')
        let startObj = new Date(startDay[0], Number(startDay[1]) - 1, startDay[2])
        let endObj = new Date(endDay[0], Number(endDay[1]) - 1, endDay[2])
        return Math.floor((endObj - startObj) / (1000 * 3600 * 24))
      } else {
        return '暂无记录'
      }
    }
  }
}
</script>

<style lang="less" scoped>
.container.detail-msg {
  padding: 0;
}
.container.basic-msg {
  padding: 10px;
  display: flex;
  margin-top: 0;
  position: relative;
  .left {
    flex: 0 0 90px;
    width: 90px;
    height: 64px;
    background-color: #2165f9;
    border-radius: 4px;
    color: #fff;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 26px;
    .text-box {
      .department {
        font-size: 16px;
      }
      .doctor {
        font-size: 12px;
      }
      .time {
        font-size: 12px;
      }
    }
  }
  .right {
    font-size: 14px;
    flex: 1;
    align-self: center;
    display: flex;
    flex-wrap: wrap;
    div {
      margin-right: 40px;
    }
  }
  .patient-icon {
    position: absolute;
    right: 24px;
    bottom: 12px;
    // transform: translate3d(-50%, -50%, 0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    i {
      display: inline-block;
      height: 18px;
      width: 18px;
      background-image: url("../../assets/image/patient360.png");
      background-size: 100% 100%;
      background-repeat: no-repeat;
      background-position: center center;
      margin-right: 4px;
    }
    .patient-icon-span {
      font-size: 13px;
      color: #2165f9;
    }
  }
}
.line-title {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.title-icon {
  display: flex;
  align-items: center;
  i {
    display: inline-block;
    height: 30px;
    width: 30px;
    margin-right: 12px;
  }
}
.checkout-icon {
  i {
    background-image: url("../../assets/image/checkout.png");
  }
}
.inspect-icon {
  i {
    background-image: url("../../assets/image/inspect.png");
  }
}
.history-icon {
  i {
    background-image: url("../../assets/image/history.png");
  }
}
.detail-info {
  padding: 10px;
}
.title-line {
  display: flex;
  justify-content: space-between;
  background-color: #eeeeee;
  padding: 10px;
  // margin: 10px 0;
  .checkout-data-title {
    color: #333;
    font-size: 14px;
    i {
      display: inline-block;
      height: 14px;
      width: 14px;
      background-image: url("../../assets/image/title-icon (2).png");
      background-size: 100% 100%;
    }
  }
  .extend-checkout-data {
    cursor: pointer;
    color: #2165f9;
    font-size: 14px;
  }
}
.checkout-info {
  margin-bottom: 10px;
}
.get-detail {
  display: inline-block;
  background-image: url("../../assets/image/title-icon.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  height: 16px;
  width: 16px;
  cursor: pointer;
}
</style>
